package com.example.demo.mp.service.impl;

import cn.hutool.crypto.SecureUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.mp.entity.Userinfo;
import com.example.demo.mp.mapper.UserinfoMapper;
import com.example.demo.mp.service.UserinfoService;
import org.springframework.stereotype.Service;

/**
 * (Userinfo)表服务实现类
 *
 * @author makejava
 * @since 2024-12-14 15:58:05
 */
@Service
public class UserinfoServiceImpl extends ServiceImpl<UserinfoMapper, Userinfo> implements UserinfoService {

    @Override
    public void updatePwd(String pwd){
        LambdaUpdateWrapper<Userinfo> lambdaUpdateWrapper = Wrappers.<Userinfo>lambdaUpdate()
                .set(Userinfo::getUserPassword, SecureUtil.md5(pwd));
        this.update(lambdaUpdateWrapper);
    }

}

